<%@ page import="java.sql.*" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="a03.pojo.Major" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>显示所有专业信息</title>
</head>
<body>
<a href="addMajor.jsp">添加专业</a>
<%
    //获取session中所保存的专业信息
    ArrayList<Major> allMajors= (ArrayList<Major>) session.getAttribute("allMajors");
%>
<table border='1'>
    <tr><td>专业ID</td><td>专业名称</td><td>编辑</td></tr>
<c:forEach items="${allMajors}" var="obj">
    <tr>
        <td>${obj.id}</td>
        <td>${obj.majorName}</td>
        <td>
            <a href='findMajorByIdServlet?id=${obj.id}'>修改</a>
            <a href='deleteMajorServlet?id=${obj.majorName}'>删除</a>
        </td>
    </tr>
</c:forEach>
</table>
</body>
</html>
